Now that you have coded your first program, it's up to you to solve this Coding Challenge!
To get started, answer the questions by clicking on your answer.
In programming, a bug is what we call an error in our code. When we find and fix a bug, it is called debugging.
Each program in this challenge has a bug in it. Debug all five programs to win the Coding Challenge!
Click Submit and Next after you've answered the questions to begin!
To navigate the page using the TAB key, first press ESC to exit the code editor.
question1 = MCQ(1,"","","","","","", "row")
question1.set_prompt(" 1) What is coding?")
question1.set_choice_A("Hacking")
question1.set_choice_B("Reading a secret code")
question1.set_choice_C("Using a language that the computer can understand")
question1.set_choice_D("Typing random letters and symbols")
question1.set_correct("C")
question2 = MCQ(2,"","","","","","", "row")
question2.set_prompt("2) What is a computer program?")
question2.set_choice_A("a set of instructions for a computer to do a certain task")
question2.set_choice_B("any type of game")
question2.set_choice_C("a webpage")
question2.set_choice_D("a club or class that you take after school")
question2.set_correct("A")
question3 = MCQ(3,"","","","","","", "row")
question3.set_prompt("3) What is debugging?")
question3.set_choice_A("killing ants and cockroaches.")
question3.set_choice_B("finding and fixing errors in a program")
question3.set_choice_C("adding errors into some code")
question3.set_choice_D("writing a new program")
question3.set_correct("B")
repeat_test = True
stop_test = False
def test_script():
global repeat_test
global stop_test
try:
tval1 = question1.correct
except:
tval1 = "DNE"
try:
tval2 = question2.correct
except:
tval2 = "DNE"
try:
tval3 = question3.correct
except:
tval3 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == True, " ")
t1.add_failure(tval1 == False, "Q1 wrong")
t1.add_failure(tval1 == "DNE", " ")
t2 = TestObjective()
t2.add_success(tval2 == True, " ")
t2.add_failure(tval2 == False, "Q2 wrong")
t2.add_failure(tval2 == "DNE", " ")
t3 = TestObjective()
t3.add_success(tval3 == True, " ")
t3.add_failure(tval3 == False, "Q3 wrong")
t3.add_failure(tval3 == "DNE", " ")
tester = TestManager()
tester.add_test_list([t1, t2, t3])
tester.run_tests()
#tester.display_first_feedback()
if repeat_test == False:
stop_test = True
test_counter = 0
def repeat_tests():
global stop_test
global test_counter
if stop_test == False:
test_script()
if test_counter >= 100:
stop_test = True
stage.event_interval(repeat_tests, .2)
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.